﻿@model IPagedList<Blog>
@{
    ViewData["Title"] = "首页";
}

@section Scripts{
    <script type='text/javascript' src='~/js/jqpaginator.min.js'></script>
    <script>
        $(document).ready(function () {
            $("#paginator").jqPaginator({
                totalPages: @Model.TotalPages,
                currentPage: @Model.PageIndex,
                visiblePages: 1,
                prev: '<li class="prev"><a href="javascript:void(0);"><<\/a><\/li>',
                next: '<li class="next"><a href="javascript:void(0);">><\/a><\/li>',
                page: '<li class="page"><a href="javascript:void(0);"> {{page}} / {{totalPages}} <\/a><\/li>',
                onPageChange: function (num, type) {
                    if (type === 'change') {
                        location.href = '/Home/Page/' + num;
                    }
                }
            });
        });
    </script>
}
<div id="main" class="content">
    <div class="container">
        <article itemscope="itemscope">
            <div class="posts-list js-posts">
                @if (Model != null && Model.DataSet.Any())
                {
                    foreach (var item in Model.DataSet)
                    {
                        <div class="post post-layout-list" data-aos="fade-up">
                            <div class="postnormal review ">
                                <div class="post-container review-item">
                                    <div class="row review-item-wrapper">
                                        <div class="col-sm-3">
                                            <a rel="nofollow" href="/Home/Details/@item.Id">
                                                <div class="review-item-img" style="background-image: url(@item.Cover);"></div>
                                            </a>
                                        </div>
                                        <div class="col-sm-9 flex-xs-middle">
                                            <div class="review-item-title">
                                                <a href="/Home/Details/@item.Id" rel="bookmark">@item.Title</a>
                                            </div>
                                            <div class="review-item-creator"><b>发布日期：</b>@item.Created.ToShortDateString()</div>
                                            <span class="review-item-info"><b>总浏览量：</b>@item.Views 次</span>
                                        </div>
                                    </div>
                                    <div class="review-bg-wrapper">
                                        <div class="bg-blur" style="background-image: url(@item.Cover);"></div>
                                    </div>
                                </div>
                                <div class="post-container">
                                    <div class="entry-content">@item.Overview ...</div>
                                    <div class="post-footer">
                                        <a class="gaz-btn primary" href="/Home/Details/@item.Id">阅读全文</a>
                                        <span class="total-comments-on-post pull-right">
                                            标签：[
                                            @if (item.Tags != null && item.Tags.Any())
                                            {
                                                foreach (var tag in item.Tags)
                                                {
                                                    <a href="/Home/SearchByTag?tag=@tag.Name">@tag.Name </a>
                                                }
                                            }]
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    }
                }
                else
                {
                    <div class="post post-layout-list" data-aos="fade-up">
                        <div class="status_list_item icon_kyubo">
                            <div class="status_user" style="background-image: url(/images/no-image.png);">
                                <div class="status_section">
                                    <a href="/" class="status_btn">暂时无内容</a>
                                    <p class="section_p">欢迎您光临本站，我们没有找到您想要的内容。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                }
            </div>
        </article>
        <!-- post-formats end Infinite Scroll star -->
        <!-- post-formats -->
        <ul id="paginator" class="pagination js-pagination"></ul>
        <!-- -pagination  -->
    </div>
</div>

